home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / RLaB / help / SCALARS < prev    next >
Text File  |  1994-04-25  |  746b  |  32 lines

  1. SCALAR:
  2.  
  3.     In RLaB scalar numerics belong to the same class as matrix
  4.     numerics. Other than size, there is little distinction between
  5.     an array (matrix) of numbers, and a single number (scalar).
  6.  
  7.     > a = 1
  8.         1
  9.     > b = 1+2*sqrt(2+a)
  10.         4.4641016
  11.  
  12.     Scalars can have real, or complex numeric values (a real part,
  13.     and an imaginary part). A complex scalar is created by using a
  14.     complex constant. A complex constant is entered with either an
  15.     `i' or a `j' denoting the imaginary number...
  16.  
  17.     12.5i
  18.  
  19.     2j
  20.  
  21.     No spaces are allowed between the number and the `i' or `j'.
  22.     So a complex variable can be created like:
  23.  
  24.     a = 1.5 - 3j
  25.  
  26.     You can also use the MATLAB approach...
  27.  
  28.     i = sqrt(-1);
  29.     a = 1.5 - 3*i
  30.  
  31.     See `help COMPLEX' for more info on complex variables.
  32.